


// Source File Name:   NEWARRAY.java

package com.vhly.classfile.bytecode;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

// Referenced classes of package com.vhly.classfile.bytecode:
//            BaseCode

public class NEWARRAY
        implements BaseCode {

    private int offset;
    private int type;

    public NEWARRAY() {
    }

    public String getName() {
        return "NEWARRAY";
    }

    public int getOp() {
        return 188;
    }

    public int length() {
        return 2;
    }

    public void read(DataInputStream din)
            throws IOException {
        type = din.read();
        if (type < 4 || type > 11)
            throw new IOException("NewArray is Error");
        else
            return;
    }

    public void write(DataOutputStream dout)
            throws IOException {
        dout.write(188);
        dout.write(type);
    }

    public int getOffset() {
        return offset;
    }

    public String getDescrption() {
        String ret = "";
        return ret;
    }

    public void setType(int ty) {
        type = ty;
        if (ty > 11)
            type = 11;
        if (ty < 4)
            type = 4;
    }

    public int getType() {
        return type;
    }

    public void setOffset(int off) {
        offset = off;
    }
}